package com.crm.jdy.service.usermanager;

import com.crm.jdy.common.pojo.RolePermiss;
import com.crm.jdy.common.mapper.RolePermissMapper;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**   
 * @Description:(用户角色关联权限服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class RolePermissServiceImpl  extends ServiceImpl<RolePermissMapper,RolePermiss> implements RolePermissService  {


    @Autowired
    RolePermissMapper rolePermissDao;



    @Override
    public boolean removeRolePermiss(String rpid) {
        return rolePermissDao.deleteById(rpid) > 0;
    }

    @Override
    public boolean addRolePermiss(RolePermiss roleInfo) {
        return rolePermissDao.insert(roleInfo) > 0;
    }

    @Override
    public boolean updateRolePermiss(RolePermiss roleInfo) {
        return rolePermissDao.updateById(roleInfo) > 0;
    }

    @Override
    public List<RolePermiss> seleteRolePermiss(RolePermiss callAplanInfoDto) {
        return rolePermissDao.seleteRolePermiss(callAplanInfoDto);
    }

    @Override
    public boolean insertAllRolePermiss(List<RolePermiss> permissList) {
        return this.saveBatch(permissList);
    }

}